import request from '@/utils/request'

const roleApi = {
  RoleAdd: '/admin/role/add', // 角色新增
  RoleList: '/admin/role/list', // 角色列表
  RoleUpdate: '/admin/role/update', // 角色列表
  Permission: '/admin/role/permission/get', // 角色权限获取
  PermissionGetAll: '/admin/role/permission/getAll', // 系统所有权限获取
  PermissionUpdate: '/admin/role/permission/update', // 角色权限编辑
}

export function roleAdd(parameter) {
  return request({
    url: roleApi.RoleAdd,
    method: 'post',
    data: parameter,
  })
}

export function roleList(parameter) {
  return request({
    url: roleApi.RoleList,
    method: 'post',
    data: parameter,
  })
}

export function roleUpdate(parameter) {
  return request({
    url: roleApi.RoleUpdate,
    method: 'post',
    data: parameter,
  })
}

export function permission(parameter) {
  return request({
    url: roleApi.Permission,
    method: 'post',
    data: parameter,
  })
}

export function permissionGetAll(parameter) {
  return request({
    url: roleApi.PermissionGetAll,
    method: 'post',
    data: parameter,
  })
}

export function permissionUpdate(parameter) {
  return request({
    url: roleApi.PermissionUpdate,
    method: 'post',
    data: parameter,
  })
}
